﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using ListenMusic.Album_ServiceReference;
using System.ServiceModel;
namespace ListenMusic.Models.Public
{
    public class AlbumRepository
    {
        AlbumServiceClient sv = new AlbumServiceClient();
        public List<Album> getAllAlbum()
        {
            try
            {
                Album[] lst_album = sv.getAllAlbum();
                return lst_album.ToList();
            }
            catch (FaultException ex)
            {
                throw ex;
            }
        }
        public List<Album> getAllAlbumByCountry(int CountryID)
        {
            try
            {
                Album[] lst_albumVN = sv.getAlbumByCountry(CountryID);
                return lst_albumVN.ToList();
            }
            catch (FaultException ex)
            {
                throw ex;
            }
        }
        public List<DataContract_Album> gettopAlbum(int number)
        {
            try
            {
                DataContract_Album[] lst_topAlbum = sv.getTopAlbum(number);
                return lst_topAlbum.ToList();
            }
            catch (FaultException ex)
            {
                throw ex;
            }
        }
        public List<Album> getnewAlbum(int number)
        {
            try
            {
                Album[] lst_newAlbum = sv.getnewAlbum(number);
                return lst_newAlbum.ToList();
            }
            catch (FaultException ex)
            {
                throw ex;
            }
        }
        public List<Album> getAlbumBySinger(string singerName)
        {
            try
            {
                Album[] lstAlbum = sv.getAlbumBySingerName(singerName);
                return lstAlbum.ToList();
            }
            catch (FaultException ex)
            {
                throw ex;
            }
        }
    }
}